<?php
$nom = 1;
$email = 1;
$captcha = 1;
$success = "yes";

if($_POST["realname"] == "")
	$nom = 0;

if(!filter_var($_POST["email"], FILTER_VALIDATE_EMAIL))
	$email = 0;

if($_POST["captcha"] != 9)
	$captcha = 0;

if($nom && $email && $captcha){
	$message = "De : ".$_POST["realname"]."\nMessage : ".$_POST["comments"];
	$message = wordwrap($message, 70);
	mail("dreaky255@gmail.com", $_POST["title"], $message, "From: ".$_POST["email"]);
	}
else {$success = "no";}

Header("Location: /index.php?page=contact&success=".$success."&n=".$nom."&m=".$email."&c=".$captcha);

?>